
#if defined Q_WS_MAC
#include <QtPlugin>
Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qmng)
Q_IMPORT_PLUGIN(qgif)
Q_IMPORT_PLUGIN(qtiff)
#endif



#include "singleapplication.h"

#ifdef Q_OS_WIN
#define _WIN32_WINNT 0x0501
#include <qt_windows.h>
#include "windows.h"
#include "winerror.h"
#endif

#if defined Q_WS_WIN
#include "windows.h"
#include "winerror.h"



#endif




#include "guimaincase.h"
#include "config.h"
#include <QtGui>
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QString titles =  "House Manager ETV versione 2.1";
    a.setOrganizationName("CrossKern");
    a.setOrganizationDomain("crosskern.com");
    a.setApplicationName("Gestione Case Vallemaggia");
    SingleApplication instance(QString("HouseManagerETV"),&a);
    if(instance.isRunning())
	{ 
        QString message = GuiMainCase::tr("Istanza gia aperta con il numero :)\nPID: %1").arg(a.applicationPid());
		if(instance.sendMessage(message))
            
         return 0;
    }
    GuiMainCase w;
    w.setWindowTitle(titles);
    w.show();
    QObject::connect(&instance, SIGNAL(messageReceived(const QString&)), &w, SLOT(handleMessage(const QString&)));
    return a.exec();
}





